package hwOne4;

import java.util.Scanner;

public class EqualPairsQuadratic {
    public static void main(String[] args) {
        // 从输入读取整数
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入整数，空格分隔：");
        String[] input = scanner.nextLine().split(" ");
        int[] nums = new int[input.length];
        for (int i = 0; i < input.length; i++) {
            nums[i] = Integer.parseInt(input[i]);
        }

        // 双重循环计算相等的整数对
        int count = 0;
        int N = nums.length;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                if (nums[i] == nums[j]) {
                    count++;
                }
            }
        }

        // 输出结果
        System.out.println("相等的整数对数量：" + count);
    }
}
